mini.parse();
var grid = mini.get("tabs1");
var form = new mini.Form("form1");
// 接收父页面传过来的值的方法
function SetData(data){
    data = mini.clone(data);       //将父页面传过来的值深克隆一下
    console.log(data.row);
    if(data.action=="edit"){      //当状态是edit的时候
        var id=data.row.id        //打点调用你获取要用的ID参数下面换成正确额得接口调用
        console.log(id);
        $.ajax({
            url: "http://localhost:8080/DSMP/meetings/findByid.do",
            type: "post",
            contentType: "application/json",
            data:boardRoom,
            success: function(data) {//请求成功完成后要执行的方法
                data = JSON.parse(data);
                form.setData(data.data);
            },
            error:function(data){
                mini.alert("cuole");
            }
        });

    }else if(data.action=="new"){

    }
}



function closeWindow(action) {            //关闭子页面
    if (window.CloseOwnerWindow)
        return window.CloseOwnerWindow(action);
    else{
        window.opener = null;
        window.open('', '_self');
        window.close();
    }

}
function onCancel(){
    closeWindow();

}
function onOk(){
    var boardRoom = form.getData();
    console.log(boardRoom);

    boardRoom = JSON.stringify(boardRoom);
    console.log(boardRoom);
    $.ajax({
        url: "http://localhost:8080/DSMP/meetings/insertMeetings.do",
        type: "post",
        contentType: "application/json",
        data:boardRoom,
        success: function(data) {//请求成功完成后要执行的方法
            console.log(data);
        },
        error:function(data){
            mini.alert("cuole");
        }
    });
    closeWindow("ok");
}
